﻿namespace Sidvall.UI.Entities
{
    public class IdentityProviderCollection : BusinessBaseCollection<IdentityProvider>
    {
        #region Public Members

        #region Add

        public IdentityProvider Add(string key, string name, Sidvall.UI.Dialogs.IIdentityProviderDialogManager dialogManager)
        {
            var item = new IdentityProvider()
            {
                Key = key,
                Name = name,
                DialogManager = dialogManager,
            };
            Add(item);
            return item;
        }

        #endregion
        #region Unload

        public void Unload()
        {
            foreach (var item in this)
            {
                if (item.DialogManager != null)
                    item.DialogManager.Unload();
            }
        }

        #endregion

        #endregion
        #region Constructors

        public IdentityProviderCollection()
        {
        }

        #endregion
    }
}
